package com.wc.算法基础课.C第三讲搜索与图论.拓扑排序.自定义字典序;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/4/3 16:26
 * @description https://www.acwing.com/problem/content/5566/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 110, M = 30;
    static boolean[][] g = new boolean[M][M];
    static char[][] ss = new char[N][N];
    // 入度
    static int[] d = new int[M];
    static int[] q = new int[M];
    static int hh = 1, tt = 0;
    static int n;

    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            ss[i] = (" " + sc.next()).toCharArray();
        }
        for (int i = 2; i <= n; i++) {
            if (!work(ss[i - 1], ss[i])) {
                System.out.println("Impossible");
                return;
            }
        }

        for (int i = 0; i < 26; i++) {
            for (int j = 0; j < 26; j++) {
                if (g[i][j]) d[j]++;
            }
        }
        if (topSort()) {
            for (int i = 1; i <= 26; i++) {
                out.print((char) (q[i] + 'a'));
            }
        } else {
            out.println("Impossible");
        }
        out.flush();
    }

    static boolean work(char[] s, char[] t) {
        for (int i = 1; i < s.length && i < t.length; i++) {
            if (s[i] != t[i]) {
                g[s[i] - 'a'][t[i] - 'a'] = true;
                return true;
            }
        }
        return s.length <= t.length;
    }

    static boolean topSort() {
        for (int i = 0; i < 26; i++) {
            if (d[i] == 0) q[++tt] = i;
        }

        while (hh <= tt) {
            int x = q[hh++];
            for (int i = 0; i < 26; i++) {
                if (g[x][i]) {
                    d[i]--;
                    if (d[i] == 0) q[++tt] = i;
                }
            }
        }

        return tt == 26;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
